Imports System.Data.SqlClient

Imports TaxonNamesInterface

Public Class DBData

    Private Shared ConnectionString As String = Configuration.ConfigurationManager.ConnectionStrings("names").ConnectionString

    'Public Shared Sub CleanDatabase()
    '    Using cnn As New SqlConnection(ConnectionString)
    '        cnn.Open()

    '        Using cmd As SqlCommand = cnn.CreateCommand()
    '            cmd.CommandText = "sprUpdate_CleanDatabase"
    '            cmd.CommandType = CommandType.StoredProcedure

    '            cmd.ExecuteNonQuery()
    '        End Using

    '        If cnn.State <> ConnectionState.Closed Then cnn.Close()
    '    End Using
    'End Sub

    Public Shared Function ResolveDeprecatedLSID(ByVal oldLSID As String) As String
        Dim db As New NamesDB(ConnectionString)
        Dim lsid As String = (From tbl In db.Deprecateds Where tbl.DeprecatedLSID = oldLSID Select tbl.NewLSID).First

        Return lsid
    End Function
End Class
